import {createRouter, createWebHistory} from 'vue-router'
import Login from "@/views/Login/Login";
import StudentsLogin from "@/views/Login/StudentsLogin";
import TeachersLogin from "@/views/Login/TeachersLogin";
import AdministratorLogin from "@/views/Login/AdministratorLogin";
import test from "@/views/test/test";
import register from "@/views/test/register";
import selectuserlist from "@/views/test/selectuserlist";
import index from "@/views/index/index";
import createResults from "@/views/index/createResults";
import createUser from "@/views/index/createUser";
import ListResults from "@/views/index/ListResults";
import ListUser from "@/views/index/ListUser";
import UserDate from "@/views/index/UserDate";
import EmailCheck from "@/views/ChangePwd/EmailCheck";
import ModifyPwd from "@/views/ChangePwd/ModifyPwd";
import showclassstudent from "@/views/index/showclassstudent";
import showTeacher from "@/views/index/showTeacher";
import createstudent from "@/views/index/createstudent";
import showgradeallresults from "@/views/index/showgradeallresults";
import Achievement from "@/views/index/Achievement";
import showstudent from "@/views/index/showstudent";

const routes = [
    {
        path: '/',
        name: 'Login登录',
        component: Login,
        children: [
            {
                path: '/',
                name: 'StudentsLogin学生登录',
                component: StudentsLogin
            },
            {
                path: '/TeachersLogin',
                name: 'TeachersLogin教师登录',
                component: TeachersLogin
            },
            {
                path: '/admin',
                name: 'AdministratorLogin管理员登录',
                component: AdministratorLogin
            },
        ]
    },
    {
        path: '/test',
        name: 'test测试',
        component: test,
        children: [
            {
                path: '/test_register',
                name: 'test_register测试_用户注册',
                component: register,
            },
            {
                path: '/selectuserlist',
                name: 'selectuserlist测试_遍历所有用户',
                component: selectuserlist,
            }
        ]
    },
    {
        path: '/index',
        name: 'index主页',
        component: index,
        children: [
            {
                path: '/createResults',
                name: 'createResults创建学生成绩',
                component: createResults
            },
            {
                path: '/createUser',
                name: 'createUser创建用户信息',
                component: createUser
            },
            {
                path: '/ListResults',
                name: 'ListResults查看学生成绩',
                component: ListResults
            },
            {
                path: '/ListUser',
                name: 'ListUser查询用户信息',
                component: ListUser
            },
            {
                path: '/showclassstudent',
                name: 'showclassstudent查询所在班级学生信息',
                component: showclassstudent
            },
            {
                path: '/UserDate',
                name: 'UserDate个人中心',
                component: UserDate
            },
            {
                path: '/showTeacher',
                name: 'showTeacher查询所有教师信息',
                component: showTeacher
            },
            {
                path: '/createstudent',
                name: 'createstudent学生注册',
                component: createstudent
            },
            {
                path: '/showgradeallresults',
                name: 'showgradeallresults查询所在班级学生成绩',
                component: showgradeallresults
            },
            {
                path: '/Achievement',
                name: 'Achievement个人成绩',
                component: Achievement
            },
            {
                path: '/showstudent',
                name: 'showstudent查看所有学生信息',
                component: showstudent
            },

        ]
    },
    {
        path: '/EmailCheck',
        name: 'EmailCheck邮箱检查',
        component: EmailCheck
    },
    {
        path: '/ModifyPwd',
        name: 'ModifyPwd密码修改',
        component: ModifyPwd
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
